package com.qys.livesMall.app.user.mapper;

import com.qys.livesMall.app.user.model.entity.UserStatisticsDayLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qys.livesMall.finance.model.dto.user.UserIncomeDayDTO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 今日店铺和用户统计表 Mapper 接口
 * </p>
 *
 * @author
 * @since 2023-08-05
 */
public interface UserStatisticsDayLogMapper extends BaseMapper<UserStatisticsDayLog> {

    UserStatisticsDayLog queryUserRechargeInfo(@Param("dto") UserIncomeDayDTO dto);

    List<UserStatisticsDayLog> getDailyShopFinance(@Param("shopId") Long shopId, @Param("codes") List<String> codes,
                                                   @Param("time") LocalDateTime time);

    /**
     * @param relevanceId
     * @param time
     * @return
     */
    List<UserStatisticsDayLog> getGroupDailyShopFinance(@Param("relevanceId") Long relevanceId,
                                                        @Param("codes") List<String> codes,
                                                        @Param("time") LocalDateTime time);

    Long getTeamIdByShopId(Long shopId);

    void updateByUserId(@Param("dto") UserStatisticsDayLog userStatisticsDayLog);

    UserStatisticsDayLog queryUserRechargeTeamInfo(@Param("teamId") Long teamId, @Param("type") Integer type);

    List<UserStatisticsDayLog> queryUserRechargeTeamInfoS(@Param("type") Integer type);

    List<UserStatisticsDayLog> getbyUserids(@Param("userids") List<Long> userids, @Param("type") int type);

    List<UserStatisticsDayLog> getShopByUserids(@Param("userids") List<Long> userids, @Param("type") int type);

    BigDecimal getWeekbyUserid(@Param("userId") Long userId,@Param("type") Integer type);

    BigDecimal getDaybyUserid(@Param("userId") Long userId,@Param("type") Integer type);

    List<UserStatisticsDayLog> getYesterdayToType(@Param("types") List<Integer> types);

    List<UserStatisticsDayLog> getTodayToType(Integer type);
}
